<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<title>搜索结果</title>
		<link rel="stylesheet" href="/mobile/layui/css/layui.css" />
		<link rel="stylesheet" href="/mobile/css/mobile.css" />
		<script src="/mobile/js/jquery.min.js"></script>
		<script src="/mobile/js/jquery.easing.min.js"></script>
		<script src="/mobile/layui/layui.js"></script>
		<style>
			.layui-tab-content {
			    padding:0;
			}
		</style>
	</head>
	<body>
		<div class="main" style="padding-bottom: 0;">
			<div class="search_container">
				<input type="search" class="search" placeholder="输入关键词..." value="{$keyword}" />
			</div>
		</div>

		<div class="layui-tab layui-tab-brief" >
		  <ul class="layui-tab-title">
		  {volist name="result" id="item"}
		    <li {if($i==1)}class="layui-this"{/if}>
		        {switch name="$key" }
                    {case value="hangyexinxi"}行业信息{/case}
                    {case value="biaozhunbianzhi"}标准编制{/case}
                    {case value="huiyipeixun"}会议培训{/case}
                    {case value="hangyezhanhui"}行业展会{/case}
                    {case value="renwuzhuanlan"}人物专栏{/case}
                    {case value="qiye"}橡塑装备企业{/case}
                    {case value="product"}橡塑装备产品{/case}
                    {case value="shukan"}专业书刊文章{/case}
                    {default /}默认情况
                {/switch}
		    </li>
		  {/volist}
		  </ul>
		  <div class="layui-tab-content">
		    {volist name="result" id="item"}
		        <div class="layui-tab-item {if($i==1)}layui-show{/if}">
		        {switch name="$key" }
                    {case value="hangyexinxi"}
                        <ul class="arclist">
                            {volist name="item" id="detail_item"}
        					<a href="{:url('hangyexinxi/detail',['id'=>$detail_item.id])}"><li>
        						<div class="content">
        							<h3 class="title">{$detail_item.title}</h3>
        							<p class="desc">{$detail_item.content|strip_tags}</p>
        							<span class="date">{$detail_item.updatetime|date="Y-m-d",###}</span>
        						</div>
        						<div class="img" style="background-image: url({$detail_item.image});"></div>
        					</li></a>
        					{/volist}
        				</ul>
                    {/case}
                    {case value="biaozhunbianzhi"}
                        <ul class="arclist">
                            {volist name="item" id="detail_item"}
        					<a href="{:url('biaozhun/detail',['id'=>$detail_item.id])}"><li>
        						<div class="content">
        							<h3 class="title">{$detail_item.title}</h3>
        							<p class="desc">{$detail_item.content|strip_tags}</p>
        							<span class="date">{$detail_item.updatetime|date="Y-m-d",###}</span>
        						</div>
        						<div class="img" style="background-image: url({$detail_item.image});"></div>
        					</li></a>
        					{/volist}
        				</ul>
                    {/case}
                    {case value="huiyipeixun"}
                        <ul class="videolist">
                            {volist name="item" id="detail_item"}
        					<a href="{:url('huiyipeixun/detail',['id'=>$detail_item.id])}"><li>
        						<div class="video_container" style="background-image: url({$detail_item.image});"></div>
        						<h3 class="title">{$detail_item.name}</h3>
        					</li></a>
        					{/volist}
        				</ul>
                    {/case}
                    {case value="hangyezhanhui"}
                        <ul class="zhanhuilist">
                            {volist name="item" id="detail_item"}
        					<a href="{:url('hangyezhanhui/detail',['id'=>$detail_item.id])}"><li style="background-image: url({$detail_item.image});">
        						<div class="title">{$detail_item.name}</div>
        						<div class="desc">
        							<p>网址 | {$detail_item.net_address}</p>
        							<p>地址 | {$detail_item.address}</p>
        							<p>时间 | {$detail_item.start_date}-{$detail_item.start_date}</p>
        						</div>
        					</li></a>
        					{/volist}
        				</ul>
                    {/case}
                    {case value="renwuzhuanlan"}
                        <ul class="arclist">
                            {volist name="item" id="detail_item"}
        					<a href="{:url('renwu/detail',['id'=>$detail_item.id])}"><li>
        						<div class="content">
        							<h3 class="title">{$detail_item.title}</h3>
        							<p class="desc">{$detail_item.content|strip_tags}</p>
        							<span class="date">{$detail_item.updatetime|date="Y-m-d",###}</span>
        						</div>
        						<div class="img" style="background-image: url({$detail_item.image});"></div>
        					</li></a>
        					{/volist}
        				</ul>
                    {/case}
                    {case value="qiye"}
                        <ul class="qiyelist">
                            {volist name="item" id="detail_item"}
        					<a href="{:url('qiye/detail',['id'=>$detail_item.id])}"><li>
        						<div class="img" style="background-image: url({$detail_item.image});"></div>
        						<div class="content">
        							<h3 class="title">{$detail_item.name}</h3>
        						</div>
        					</li></a>
        					{/volist}
        				</ul>
                    {/case}
                    {case value="product"}
                        <ul class="goodslist">
                            {volist name="item" id="detail_item"}
        					<a href="{:url('product/detail',['id'=>$detail_item.id])}"><li class=""><div class="img" style="background-image: url({$detail_item.image});"></div>
        						<div class="title">{$detail_item.name}</div>
        						<div class="desc">{$detail_item.qiye_name}</div>
        					</li></a>
                            {/volist}
        				</ul>
                    {/case}
                    {case value="shukan"}
                        <dl class="booklist">
                            {volist name="item" id="detail_item"}
                            {if(isset($item[$i-2]))}
    							{if ($detail_item.type_name!=$item[$i-2]['type_name'])}
    							<dt class="layui-font-red">【{$detail_item.type_name}】</dt>
    							{/if}
    						{else /}
    							<dt class="layui-font-red">【{$detail_item.type_name}】</dt>
    						{/if}
        					<a href="{:url('shukan/qikanwenzhang_detail',['id'=>$detail_item.id])}"><dd>
        						<div class="title">{$detail_item.title}</div>
        						<div class="desc">
        							<p>{$detail_item.author}</p>
        							<span>详情<i class="iconfont">&#xe6a3;</i></span>
        						</div>
        					</dd></a>
        					{/volist}
        				</dl>
                    {/case}
                    {default /}默认情况
                {/switch}


		        </div>
		    {/volist}


		  </div>
		</div>
	</body>

</html>
<script>
    $("input.search").keypress(function (e) {
		    	// 兼容写法
		      e = e || window.event;
		      key = e.keyCode || e.which || e.charCode;
		      if (key == 13) {
		          console.log($(this).val());
				  if($(this).val().trim()==''){
					  alert('请输入关键词');
					  return false;
				  }
				  window.open('{:url('index/search')}?keyword='+$(this).val(),'_blank')
		      }
		  });
</script>
